package com.emergency.base.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 方案计划类
 */
@Entity
@Table(name="bus_plan")
public class Plan extends BaseEntity{

	/**计划名称*/
	private String name;
	/**开始时间*/
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	private Date startTime;
	/**结束时间*/
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	private Date endTime;

	/**想定*/
	@OneToOne(targetEntity=Scenar.class,fetch= FetchType.LAZY)
	@JoinColumn(name="scenar_id",referencedColumnName="id")
	private Scenar scenar;

	/**临时属性*/
	@Transient
	private List<PlanDetail> planDetails;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public List<PlanDetail> getPlanDetails() {
		return planDetails;
	}

	public void setPlanDetails(List<PlanDetail> planDetails) {
		this.planDetails = planDetails;
	}

	public Scenar getScenar() {
		return scenar;
	}

	public void setScenar(Scenar scenar) {
		this.scenar = scenar;
	}
}